﻿namespace IdentityService.WebAPI.Controllers.UserAdmin
{
    public record AddAdminUserRequest(string UserName, string Name, string Avatar, string PhoneNum);
    public class AddAdminUserRequestValidator : AbstractValidator<AddAdminUserRequest>
    {
        public AddAdminUserRequestValidator()
        {
            RuleFor(e => e.PhoneNum).NotNull().NotEmpty().MaximumLength(11);
            RuleFor(e => e.UserName).NotNull().NotEmpty().MaximumLength(20).MinimumLength(2);
            RuleFor(e => e.Name).NotNull().NotEmpty().MaximumLength(20);
            RuleFor(e => e.Avatar).NotNull().NotEmpty().MaximumLength(100);
        }
    }
}
